<!-- Copyright (c) 2019-2020 十三 all rights reserved. -->
<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:replace="mall/header::head-fragment('NewBee商城-搜索','search')">
</head>
<body>
<header th:replace="mall/header::header-fragment"></header>
<!-- nav -->
<nav th:replace="mall/header::nav-fragment"></nav>

<!--分类筛选-->
<div class="classify">
    <div class="category">
        <div class="category_bar">
            <th:block th:if="${searchPageCategoryVO!=null}">
                <div class="fm c">
                    <a href="##" class="qqq" th:text="${searchPageCategoryVO.secondLevelCategoryName}">newbee-mall</a>
                    <div>
                        <th:block th:each="thirdLevelCategory : ${searchPageCategoryVO.thirdLevelCategoryList}">
                            <a th:href="@{${'/search?goodsCategoryId='+thirdLevelCategory.categoryId}}"
                               th:text="${thirdLevelCategory.categoryName}">newbee-mall</a>
                        </th:block>
                    </div>
                </div>
                <i><img src="mall/image/right-@1x.png" alt=""></i>
                <div class="findword">"
                    <th:block th:text="${searchPageCategoryVO.currentCategoryName}"></th:block>
                    "
                </div>
            </th:block>
            <th:block th:if="${searchPageCategoryVO==null}">
                <th:block th:if="${keyword!=null and keyword !=''}">
                    <div class="findword">搜索 "
                        <th:block th:text="${keyword}"></th:block>
                        "
                    </div>
                </th:block>
            </th:block>
        </div>
    </div>
</div>

<!--排序-->
<div class="sort">
    <div class="list">
        <a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy=default'}">
            <div th:class="${orderBy==null || orderBy=='default'?'active':''}">推荐</div>
        </a>
        <a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy=new'}">
            <div th:class="${orderBy=='new'?'active':''}">新品</div>
        </a>
        <a th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy=price'}">
            <div th:class="${orderBy=='price'?'active':''}">价格</div>
        </a>
    </div>
</div>

<div class="goods_item center">
    <div class="main center">
        <th:block th:if="${#lists.isEmpty(pageResult.list)}">
            <img style="margin-top: 16px;padding: 16px 20px;" th:src="@{/mall/image/null-content.png}">
        </th:block>
        <th:block th:unless="${#lists.isEmpty(pageResult.list)}">
            <th:block th:each="goods : ${pageResult.list}">
                <div class="item_card_frame">
                    <div class="item_card"><a th:href="@{'/goods/detail/'+${goods.goodsId}}" target="_blank"><img
                            th:src="@{${goods.goodsCoverImg}}" th:alt="${goods.goodsName}"></a></div>
                    <div class="item_brand"><a th:href="@{'/goods/detail/'+${goods.goodsId}}" target="_blank"
                                               th:text="${goods.goodsName}">newbee.ltd</a></div>
                    <div class="item_sub_intro" th:text="${goods.goodsIntro}">newbee.ltd</div>
                    <div class="item_price" th:text="${goods.sellingPrice+'.00元'}">1299.00元</div>
                </div>
            </th:block>
        </th:block>
        <div class="clear"></div>
    </div>
    <div class="pages">
        <div class="page_wrap">
            <th:block th:if="${null != pageResult and !#lists.isEmpty(pageResult.list)}">
            <span class="page_span1">
                 <a th:href="@{${pageResult.currPage==1}?'##':'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage-1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}">
                                    < 上一页
                                </a>
                <th:block th:if="${pageResult.currPage-2 >=1}"><a
                        th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage-2}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
                        th:text="${pageResult.currPage -2}">1</a></th:block>
                <th:block th:if="${pageResult.currPage-1 >=1}"><a
                        th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage-1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
                        th:text="${pageResult.currPage -1}">1</a></th:block>
                <a href="##" class="active" th:text="${pageResult.currPage}">1</a>
                <th:block th:if="${pageResult.currPage+1<=pageResult.totalPage}"><a
                        th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage+1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
                        th:text="${pageResult.currPage +1}">1</a></th:block>
                <th:block th:if="${pageResult.currPage+2<=pageResult.totalPage}"><a
                        th:href="@{'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage+2}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}"
                        th:text="${pageResult.currPage +2}">1</a></th:block>
                 <a th:href="@{${pageResult.currPage>=pageResult.totalPage}?'##':'/search?keyword='+${keyword==null?'':keyword}+'&page=' + ${pageResult.currPage+1}+'&goodsCategoryId='+${goodsCategoryId==null?'':goodsCategoryId}+'&orderBy='+${orderBy==null?'':orderBy}}">
                                    下一页 >
                                </a>
					</span>
            </th:block>
        </div>
    </div>
</div>

<div th:replace="mall/footer::footer-fragment"></div>
<!-- jQuery -->
<script th:src="@{/admin/plugins/jquery/jquery.min.js}"></script>
<script th:src="@{/mall/js/search.js}" type="text/javascript"></script>
</body>
</html>